﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GameLogic
{
	public class PosicionableObject
	{
		// Orientations
		public const int Right = 2;
		public const int Left = 6;
		public const int Up = 4;
		public const int Down = 0;
		public const int RightUp = 3;
		public const int RightDown = 1;
		public const int LeftUp = 5;
		public const int LeftDown = 7;

		protected Position2D pos;
		protected bool isSelected = false;

		protected int maxLife;
		protected int life;

		public PosicionableObject()
		{
			
		}

		public virtual void setPosition(Position2D pos)
		{
			this.pos = pos;
		}

		public float getXPosition()
		{
			return pos.X;
		}

		public float getYPosition()
		{
			return pos.Y;
		}

		protected void move(float x, float y)
		{
			pos.add(x, y);
		}

		public bool IsSelected()
		{
			return isSelected;
		}

		public void select()
		{
			isSelected = true;
		}

		public void unselect()
		{
			isSelected = false;
		}

		public int getLife()
		{
			return life;
		}

		public float getPercentLife()
		{ 
			return (float)life / (float)maxLife;
		}
	}
}
